﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace DataAccess
{
    public class ParametersDAO
    {
        private DataAccess _conn;
        public ParametersDAO()
        {
            _conn = new DataAccess();
        }

        public DataTable Link_Lien_He()
        {

            return _conn.ExecuteSelectQuery("SELECT PARAMETER_NAME FROM PARAMETERS WHERE PARAMETER_CODE = 'link_lien_he' ORDER BY ORDERING", null);
        }

        public DataTable ColorForm()
        {

            return _conn.ExecuteSelectQuery("SELECT PARAMETER_NAME FROM PARAMETERS WHERE PARAMETER_CODE = 'color'", null);
        }

        public void Update_ColorForm(string str)
        {
            SqlParameter[] param = new SqlParameter[1];

            param[0] = new SqlParameter("@P_STR", SqlDbType.NVarChar);
            param[0].Value = str;

            _conn.ExecuteNonQuery("UPDATE_COLOR_FORM", param);
        }
    }
}
